/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ventasimple.dao;

import com.ventasimple.modelo.TipoPublicacion;
import java.io.Serializable;
import java.util.List;

/**
 * @author Claudio
 */
public class TipoPublicacionDAO extends BaseDAO<TipoPublicacion> implements Serializable {
    
    public List<TipoPublicacion> getLista(){
        try {
            
            String sQuery = "SELECT t FROM TipoPublicacion t "
                +" WHERE t.activa = 'S' "                 
                +" ORDER BY t.id ";                       
                        
            return execQueryList(sQuery);
            
        } catch (Exception e) {
            e.printStackTrace();
            System.err.print("ERROR: " + e.getMessage());
            return null;
        }        
    }   

    public TipoPublicacion getTipoPublicacion(Integer id) {
        
        return getObjeto(TipoPublicacion.class, id);
        
    }
    
}
